import {User} from "./user"

class RankHandle {
    ranks = []

    constructor(ranks) {
        this.ranks = ranks
    }

    ranksDurationTurnHour() {
        return this.ranks.map(item =>
            item.hour = item.duration / 60 / 60
        );
    }

    getRankSelf() {
        const user = new User()
        return this.ranks.find(item => {
            return item.user.id === user.user.id
        })
    }
}
export {
    RankHandle
}
